import util from 'util'

let filters = {
	toFixedPrice:(value) => {
		return parseFloat(value).toFixed(2)
	},
	toFixedInt:(value) => {
		return parseFloat(value).toFixed(0)
	},
	dateFormatYMDHMS:(value) => {
		return util.formatDate(value,'yyyy-MM-dd hh:mm:ss')
	},
	dateFormatSub:(value) => {
		return value.substr(0,value.length-4)
	},
	dateFormatYMDHMSCoupon:(value) => {
		return util.formatDate(value*1000,'yyyy-MM-dd hh:mm:ss')
	},
	dateFormatYMD:(value) => {
		return value?util.formatDate(value,'yyyy-MM-dd'):''
	},
	countdown:(value) => {
		return value?util.countdownForSecond(value):''
	},
}

export default filters